﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="buyer_range.aspx.cs" Inherits="PeisongWeb.buyer.buyer_range" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>食材初始化设置</title>
    <!--#include file="/global.inc" -->

    <script src="/app_common/scripts/jquery-latest.pack.js" type="text/javascript"></script>

    <script src="/fromjs/fillscreenFix.js" type="text/javascript"></script>

    <script type="text/javascript">
        function checktxtlength(obj) {
            if (obj.value.length > 50) {
                obj.select();
                alert("输入字符请不要超过50个（汉字占两个字符）！");
            }
        }
        function checktxttype(obj) {
            var test = /^\d+(\.\d{1,2})?$/;
            if (test.test(obj.value)) {
                if (obj.value == "0") {
                    obj.value = "1"
                    return true;
                }
                else
                    return true;
            }
            else {
                obj.value = "1"
                return true;
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="container">
        <uc1:headerV2 runat="server" ID="header1" />
        <div id="homemain">
            <div id="main">
                <div class="title">
                    <div class="title_text">
                        <ul>
                            <li class="color1">商品分类统计</li>
                        </ul>
                    </div>
                </div>
                <div class="line_top">
                </div>
                <div id="mainmiddle">
                    <div class="search_list">
                        <div class="search_title">
                            <span>商品分类统计</span>
                        </div>
                        <div class="listsearch">
                            <ul>
                                <li style="width: 175px;">
                                    <label>
                                        大 类：</label>
                                    <asp:DropDownList runat="server" ID="ddl_CategoryRoot" DataTextField="name" DataValueField="categoryId"
                                        AutoPostBack="True" OnSelectedIndexChanged="ddl_CategoryRoot_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </li>
                                <li style="width: 175px;">
                                    <label>
                                        小 类：</label>
                                    <asp:DropDownList runat="server" ID="ddl_CategorySub" DataTextField="name" DataValueField="categoryId">
                                    </asp:DropDownList>
                                </li>
                                <li style="width: 200px;">
                                    <label style="width: 75px;">
                                        商品编号:</label>
                                    <asp:TextBox ID="txt_ProductNo" runat="server" Width="100px"></asp:TextBox>
                                </li>
                                <li style="width: 200px;">
                                    <label style="width: 75px;">
                                        商品名称:</label>
                                    <asp:TextBox ID="txt_ProductName" runat="server" Width="100px"></asp:TextBox>
                                </li>
                                <li style="width: auto;">
                                    <asp:LinkButton ID="lbn_search" runat="server" Text="［搜索］" CausesValidation="false"
                                        OnClick="lbn_search_Click"></asp:LinkButton>
                                    <asp:LinkButton ID="lbn_reset" runat="server" Text="[重置]" CausesValidation="false"
                                        OnClick="lbn_reset_Click"></asp:LinkButton>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="list_content">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr class="list_title">
                                <td style="width: 10%">
                                    商品编号
                                </td>
                                <td style="width: 20%">
                                    商品名称
                                </td>
                                <td style="width: 20%">
                                    商品级别
                                </td>
                                <td style="width: 10%">
                                    预订数量
                                </td>
                                <td style="width: 25%">
                                    备注
                                </td>
                                <td style="width: 15%">
                                    操作
                                </td>
                            </tr>
                        </table>
                        <table border="0" cellspacing="0" cellpadding="0" class="list_border">
                            <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                                <ItemTemplate>
                                    <tr class='<%# Container.ItemIndex%2==0?"":"tr_color"  %>'>
                                        <td style="width: 10%">
                                            <%# DataBinder.Eval(Container.DataItem,"productNo") %>
                                        </td>
                                        <td style="width: 20%">
                                            <%# DataBinder.Eval(Container.DataItem,"name") %>
                                        </td>
                                        <td style="width: 20%">
                                            <%# BusinessNature(Convert.ToString(DataBinder.Eval(Container.DataItem, "businessNature")))%>
                                            <input id="Hidden1" type="hidden" value='<%# DataBinder.Eval(Container.DataItem, "businessNature")%>' />
                                        </td>
                                        <td style="width: 10%">
                                            <asp:TextBox ID="txt_amount" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "bookamount")%>'
                                                onblur="return checktxttype(this);" Width="50px"></asp:TextBox>
                                            <%# DataBinder.Eval(Container.DataItem, "unit")%>
                                        </td>
                                        <td style="width: 25%">
                                            <asp:TextBox ID="txt_Remarks" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "remarks")%>'
                                                onblur="return checktxtlength(this);"></asp:TextBox>
                                        </td>
                                        <td style="width: 15%">
                                            <asp:LinkButton ID="lbt_Remarks" runat="server" CommandName="ReamrksEdit" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"productId")+","+DataBinder.Eval(Container.DataItem,"businessNature") %>'
                                                Text="修改初始化">
                                            </asp:LinkButton>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </div>
                    <div class="page">
                        <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                            AlwaysShow="true" Width="98%" runat="server" PageSize="15" InvalidPageIndexErrorMessage="无效页码"
                            NumericButtonCount="5" PageIndexOutOfRangeErrorMessage="页码超出范围" ShowCustomInfoSection="Left"
                            CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 " CustomInfoTextAlign="Left"
                            HorizontalAlign="Right" OnPageChanged="AspNetPager1_PageChanged" NextPageText=">"
                            FirstPageText="<<首页" LastPageText="末页>>" PrevPageText="<" CssClass="paginator"
                            CurrentPageButtonClass="cpb">
                        </webdiyer:AspNetPager>
                    </div>
                </div>
            </div>
        </div>
        <uc1:footerV2 runat="server" ID="footer1" />
    </form>
</body>
</html>
